<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<h3>
	Danh sách user
</h3>
<table class="tbl-list martop10" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="pad5 td-label bold" width="35%">
			Username
		</td>
		<td class="pad5 td-label bold">
			Họ và tên
		</td>
	</tr>
	<?php
	$index = 0;
	foreach($lstUser as $user)
	{
		$bgcolor = ($index % 2 == 0) ? '' : 'style="background: #f9f9f9;"';
	?>
		<tr id="tr_<?php echo $user['user_id']; ?>" <?php echo $bgcolor; ?>>
			<td class="pad5">
				<a href="javascript:void(0);" id="uname_<?php echo $user['user_id']; ?>" onclick="selectUser('<?php echo $user['user_id']; ?>');">
					<?php echo $user['username']; ?>
				</a>
			</td>
			<td class="pad5">
				<a href="javascript:void(0);" id="fname_<?php echo $user['user_id']; ?>"  onclick="selectUser('<?php echo $user['user_id']; ?>');" >
					<?php echo $user['contact_name']; ?>
				</a>
			</td>
		</tr>
	<?php
		$index++;
	}
	?>
</table>
<?php
if(count($lstUser) > 0)
{
?>
	<table width="100%" class="martop10">
		<tr>
			<td class="pad5">
				Show <?php echo $cPage; ?> / <?php echo $pCount; ?> pages
			</td>
			
			<td class="pad5 text-right ppage">
				<?php
				if($cPage > 1)
				{
					?>
						<a href="javascript:void(0);" onclick="mssSearchUser('<?php echo ($cPage - 1); ?>')" >Previous</a>
					<?php
				}
				
				foreach($lstPaging as $page)
				{
					if($page > 0)
					{
				?>
					<a <?php echo ($page == $cPage) ? 'style="font-weight:bold;"' : '';?> href="javascript:void(0);" onclick="mssSearchUser('<?php echo $page; ?>')" ><?php echo $page;?></a>
				<?php
					}
				}
				
				if($cPage < $pCount)
				{
					?>
					<a href="javascript:void(0);" onclick="mssSearchUser('<?php echo ($cPage + 1); ?>')" >Next</a>
					<?php
				}
				?>
			</td>
		</tr>
	</table>
<?php
}
?>
<hr class="martop10 marbottom10" />